<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>VueJs指令：this上下文的问题</title>
</head>
<body>

<div id="app">
    size是:{{size}}
    <button @click="clickme">点我</button>
</div>

<script src="js/vue.min.js"></script>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            size: 0,
            username:"zhangsan",
            say:function(){

            }
        },
        creted:function(){
            this.clickme();
        },
        methods: {
            clickme: function () {

                // vue是一个好家伙个，它为开发者调用和修改方便，它把data，methods，组件，指令，过滤器等键和值全部copy挂载到最外层的vue实例对象中
                // 目的是啥：就让开发这更加方便去修改数据和调用的方法
                // 真是写法完整写法
                //this.$data.size =  this.$data.size + 1;
                this.size = this.size + 1;
            }
        }
    });


</script>
</body>
</html>